<template>
	<view>
		<u-input v-model="userEmail" placeholder="请输入邮箱" />
		<u-input type="password" v-model="password" placeholder="请输入密码" />
		<button type="default" @click="goLogin">登录</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userEmail: '',
				password: '',
				rules: '用户',
			}
		},
		methods: {
			goLogin() {
				this.$axios({
					url: 'common/RiderUser/login/' + this.userEmail + '/' + this.password + '/' + this.rules,
					method: 'GET',
					success: (res) => {
						if (res.data.code == 20000) {
							console.log(res.data.data)
							let id = res.data.data.user.id+""
							let sign = res.data.data.UserSig
							uni.$TUIKit.login({
									userID: id,
									userSig: sign
								})
								.then(function(imResponse) {

									console.log(imResponse.data); // 登录成功
									
								})
								.catch(function(imError) {
									console.warn('login error:', imError); // 登录失败的相关信息
								})
						}
						else{
							console.log("1111111111111111")
						}
					}
				})
			}
		}
	}
</script>

<style>

</style>
